/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hari3.tes.soal3;


import java.util.*;
import java.util.ArrayList;

/**
 *
 * @author Jaka
 */
public class TeamTakrawImpl implements TeamTakraw{

    private String f;
    List s = new ArrayList<Player>();



    public String add(Player p) {

        if(s.size() < 3 )
        {
            if (s.contains(p)) {
                f = "Player already exist";
            }
            else {
                s.add(p);
                f = "Player added successfully";
            }
        }
        else
        {
            f = "No more player allowed joining the team";
        }
        return f;

    }


}
